import axios from '@/libs/axios1';
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' };
let classrelation = '/self-study/classrelation';
let expTrain = '/self-study/expTrain';
let expTrainContent = '/self-study/expTrainContent';
let trainStatistics = '/self-study/trainStatistics';
//创建班级
export const addClass = (classInfo) => {
    return axios({
        url: `${expTrain}`,
        method: 'POST',
        headers: jsonHeaders,
        data: classInfo
    });
};

//编辑班级
export const modifyClass = (id, classInfo) => {
    return axios({
        url: `${expTrain}/${id}`,
        method: 'PUT',
        headers: jsonHeaders,
        data: classInfo
    });
};

//删除班级
export const delClass = (id) => {
    return axios({
        url: `${expTrain}/${id}`,
        method: 'DELETE',
        headers: jsonHeaders
    });
};

//获取班级列表
export const queryClassList = (params) => {
    return axios({
        url: `${expTrain}/page`,
        method: 'get',
        headers: jsonHeaders,
        params: params
    });
};

//获取班级详情
export const queryClassInfo = (id) => {
    return axios({
        url: `${expTrain}/${id}`,
        method: 'get',
        headers: jsonHeaders,
        params: {}
    });
};

//获取班级成员
export const getClassUsers = (id, params) => {
    return axios({
        url: `${expTrain}/users/${id}`,
        method: 'GET',
        headers: jsonHeaders,
        params: params
    });
};

//部署环境
export const deployClass = (classId, type, classNumberId, userIds) => {
    return axios({
        url: `${classrelation}/experimentManage/experimentDeploy?classId=${classId}&type=${type}&classNumberId=${classNumberId}`,
        method: 'POST',
        headers: jsonHeaders,
        data: userIds
    });
};

//批量销毁
export const batchExperimentDestroy = (params) => {
    return axios({
        url: `${classrelation}/experimentManage/experimentDestroy`,
        method: 'delete',
        data: params,
        headers: jsonHeaders
    });
};

//编辑班级状态
export const updateClassStatus = (classId, status) => {
    return axios({
        url: `${classrelation}/classManage/updateStatus?classId=${classId}&status=${status}`,
        method: 'POST',
        headers: jsonHeaders
    });
};

//创建排课
export const addTeachSchedule = (params) => {
    return axios({
        url: `${expTrainContent}/addExpTrainContent`,
        method: 'POST',
        data: params,
        headers: jsonHeaders
    });
};

//编辑排课
export const updateTeachSchedule = (params) => {
    return axios({
        url: `${expTrainContent}/updateTrainNumber`,
        method: 'POST',
        data: params,
        headers: jsonHeaders
    });
};

//查询排课
export const queryTeachSchedule = (params) => {
    return axios({
        url: `${expTrainContent}/page`,
        method: 'GET',
        headers: jsonHeaders,
        params: params
    });
};

//清空排课
export const deleteTeachSchedule = (ids) => {
    return axios({
        url: `${expTrainContent}/deleteTrainNumber`,
        method: 'POST',
        headers: jsonHeaders,
        data: ids
    });
};

export const guideSectionLearnStatistics = (egId, classNumberId, params) => {
    return axios({
        url: `${trainStatistics}/expGuide/${egId}/${classNumberId}`,
        method: 'GET',
        params,
        headers: jsonHeaders
    });
};

// 培训指导书答题统计
export const guideQuestionAnswerStatistics = (egId, classNumberId, params) => {
    return axios({
        url: `${trainStatistics}/expAnswer/${egId}/${classNumberId}`,
        method: 'GET',
        params,
        headers: jsonHeaders
    });
};

//培训随堂练习答题统计
export const answerRecord = (egId, classNumberId, params) => {
    return axios({
        url: `${trainStatistics}/answer/${egId}/${classNumberId}`,
        method: 'GET',
        params,
        headers: jsonHeaders
    });
};

//视频学习统计
export const videoLearnStatictics = (egId, classNumberId, params) => {
    return axios({
        url: `${trainStatistics}/expVideo/${egId}/${classNumberId}`,
        method: 'GET',
        params,
        headers: jsonHeaders
    });
};

//查询投屏状态
export const queryCheckScreenStatus = (params) => {
    return axios({
        url: `${classrelation}/classNumber/queryCheckScreenStatus`,
        method: 'GET',
        params: params,
        headers: jsonHeaders
    });
};

//报告评分
export const scoreClassReport = (params) => {
    return axios({
        url: `${classrelation}/classReport/modify`,
        method: 'PUT',
        data: params,
        headers: jsonHeaders
    });
};

//查询班级课节报告
export const queryClassReport = (egId, classNumberId, params) => {
    return axios({
        url: `${trainStatistics}/expReport/${egId}/${classNumberId}`,
        method: 'GET',
        params: params,
        headers: jsonHeaders
    });
};

//同步实验组教学学生
export const syncClassData = (classId) => {
    return axios({
        url: `${classrelation}/classManage/syncStus?classId=${classId}`,
        method: 'PUT',
        data: {},
        headers: jsonHeaders
    });
};

//查询部署列表
export const queryClassNumberList = (classId, params) => {
    return axios({
        url: `${classrelation}/classNumber/queryClassNumberUserDeploy/${classId}`,
        method: 'GET',
        params: params,
        headers: jsonHeaders
    });
};

//查询部署列表
export const queryClassNumberList_new = (classId, params) => {
    return axios({
        url: `${expTrain}/queryClassNumberUserDeploy/${classId}`,
        method: 'GET',
        params: params,
        headers: jsonHeaders
    });
};

//课节课件部署
export const deployClass_new = (classId, classNumberId, params) => {
    return axios({
        url: `${expTrain}/deploy/${classId}/${classNumberId}`,
        method: 'POST',
        headers: jsonHeaders,
        params
    });
};

//手动开始结束课节
export const changeClassNumberStatus = (classNumberId, status) => {
    return axios({
        url: `${expTrainContent}/status/${classNumberId}/${status}`,
        method: 'POST',
        headers: jsonHeaders
    });
};

//查询答题解析列表
export const queryExamAnalysisList = (params) => {
    return axios({
        url: `${expTrainContent}/queryExamAnalysisList`,
        method: 'GET',
        params: params,
        headers: jsonHeaders
    });
};
